function g = elliptic_g(x,y,caseNum,varargin)
switch caseNum
    case 1
        g = (1 - x.^2 - y.^2)/4;
    case 2
        g = x.^2+y.^2;
    case 3
        g = 2*(1+y)./((3+x).^2+(1+y).^2);
    case 4
        g = (x.^2+y.^2).^(1/3).*sin((2*atan2(y+eps,x+eps)+pi)/3);
    case 5
        g = 0*x;
    case 6
        g = 0*x;
    case 7
        epsilon = varargin{1};
        g = atan2(y.^2-2*x+1/2,epsilon);
    otherwise
        g = 0;
end